#ifndef __USER_SID27_SERVICE_H__
#define __USER_SID27_SERVICE_H__

// #include "can_protocol.h"
#include "Protocol_CAN.h"

#include <stdint.h>

// TODO
#define PNEUMATIC_ECU_1

// KEY
#ifdef PNEUMATIC_ECU_1
#define KEY_K_LIN 0x00A9
#define KEY_K_CAN 0x005B
#endif

#ifdef PNEUMATIC_ECU_2
#define KEY_K_LIN 0x00A9
#define KEY_K_CAN 0x005B
#endif

// 安全访问种子长度
#define UDS_SEED_LEN 2
#define UDS_KEY_LEN  2

#define REQUEST_SEED  (0x01)
#define SEND_KEY      (0x02)
#define FAS_MAX_TIMES (0x02)

typedef struct
{
    uint8_t sub_func;                // 子功能
    uint8_t data_len;                // 数据长度
    int16_t (*handle_cb)(uint8_t *); // 回调处理
} security_access_str;

int16_t Security_Access_Port(uint8_t subfunction, uint8_t *p_data);

#endif
